package com.servlet3.test;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/12/9 19:08
 * 监听项目的启动和停止
 */
public class UserListener implements ServletContextListener {
    /**
     * 监听ServletContext初始化
     *
     * @param sce
     */
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("UserListener...contextInitialized");
    }

    /**
     * 监听ServletContext销毁
     *
     * @param sce
     */
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("UserListener...contextDestroyed");
    }
}
